import re

s=re.sub('\d+',',',"156111gh48O555II",4)
print(s)

a = re.search("123","1jkj123asda")
# print(re.search("123","1jkj123asda").group())


print(re.match("123","123hjkl"))
print(re.findall(r'\w','ds.._ 4'))
print(re.findall(r'^sk','skggj,fd,7'))
print(re.findall(r'^sk','kggj,fd,7'))
print(re.findall(r'k{3,5}','ffkkkkk'))  # 取前面一个字符‘k'的3到5次，['kkkkk']
print(re.findall(r'a{2}','aasdaaaaaf'))
print(re.findall(r'a*x','aaaaaax'))   # ['aaaaaax'] 匹配前面一个字符0次或多次，贪婪匹配
print(re.findall(r'\d*', 'www33333'))  # ['', '', '', '33333', '']
print(re.findall(r'a+c','aaaacccc'))
print(re.findall(r'a?c','aaaacccc')) #  重复前面的条件，最少0个，最多1个[0,1]
print(re.findall(r'a[.]d','acdggg abd'))
print(re.findall(r'[a-z]','h43.hb -gg'))
print(re.findall(r'[^a-z]','h43.hb -gg')) # ^取反的意思，非
print(re.findall(r'ax$','dsadax'))
print(re.findall(r'a(\d+)b','a23666b'))
print(re.findall(r'a(\d+?)b','a23666b'))
print(re.findall(r'a(\d+)','a23b')) # 23
print(re.findall(r'a(\d*?)','a23b'))# ['']
print(re.findall(r'\d.*?','a23b'))# ['']
print(re.findall(r'a(\d+?)','a23b'))  # 2

print(re.match(r'a\d','a333333a4').group())
print(re.match(r'a\d','ta333333a4'))
print(re.search(r'a\d','ta333333a4').group())
print(re.search(r'a(\d+)','a23b').group())
print(re.search(r'a(\d+?)','a2366666666666b').group())
print(re.search(r'a(\d+)b','a23666b').group(1))